<%@ page import="edu.uow.devdocs.Project" %>

<table class="searchable tableForm">
	<tr>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'name', 'error')}"><label for="name"><g:message code="project.name.label" default="Name" /></label></td>
		<td colspan="3" class="fieldcontain ${hasErrors(bean: projectInstance, field: 'name', 'error')}"><g:textField name="name" class="large" maxlength="100" value="${projectInstance?.name}"/></td>
	</tr>
	<tr>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'description', 'error')}"><label for="description"><g:message code="project.description.label" default="Description" /></label></td>
		<td colspan="3" class="fieldcontain ${hasErrors(bean: projectInstance, field: 'description', 'error')}"><g:textArea name="description" class="large" rows="5" maxlength="10000" value="${projectInstance?.description}"/></td>
	</tr>
	<tr>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'persons', 'error')}"><label for="persons"><g:message code="project.persons.label" default="Persons" /></label></td>
		<td colspan="3" class="fieldcontain ${hasErrors(bean: projectInstance, field: 'persons', 'error')}"><g:select noSelection="[null:'']" name="persons" from="${edu.uow.devdocs.Person.list()}" multiple="multiple" optionKey="id" size="5" value="${projectInstance?.persons*.id}" class="many-to-many large"/></td>
	</tr>
	<tr>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'status', 'error')}"><label for="status"><g:message code="project.status.label" default="Status" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'status', 'error')}"><g:select id="status" name="status.id" from="${edu.uow.devdocs.ProjectStatus.list()}" optionKey="id" value="${projectInstance?.status?.id}" class="many-to-one" noSelection="['null': '']"/></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'startDate', 'error')}"><label for="startDate"><g:message code="project.startDate.label" default="Start Date" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'startDate', 'error')}"><g:jqDatePicker name="startDate" precision="day"  value="${projectInstance?.startDate}" default="none" noSelection="['': '']" /></td>
	</tr>
	<tr>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'projectType', 'error')}"><label for="projectType"><g:message code="project.projectType.label" default="Project Type" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'projectType', 'error')}"><g:select id="projectType" name="projectType.id" from="${edu.uow.devdocs.ProjectType.list()}" optionKey="id" value="${projectInstance?.projectType?.id}" class="many-to-one" noSelection="['null': '']"/></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'endDate', 'error')}"><label for="endDate"><g:message code="project.endDate.label" default="End Date" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'endDate', 'error')}"><g:jqDatePicker name="endDate" precision="day"  value="${projectInstance?.endDate}" default="none" noSelection="['': '']" /></td>
	</tr>
	<tr>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'businessOwner', 'error')} required"><label for="businessOwner"><g:message code="project.businessOwner.label" default="Business Owner" /> <span class="required-indicator">*</span></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'businessOwner', 'error')} required"><g:select id="businessOwner" name="businessOwner.id" from="${edu.uow.devdocs.Person.list()}" optionKey="id" required="" value="${projectInstance?.businessOwner?.id}" class="many-to-one"/></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'estimatedHours', 'error')}"><label for="estimatedHours"><g:message code="project.estimatedHours.label" default="Estimated Hours" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'estimatedHours', 'error')}"><g:field type="number" name="estimatedHours" value="${fieldValue(bean: projectInstance, field: 'estimatedHours')}"/></td>
	</tr>
	<tr>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'developmentManager', 'error')} required"><label for="developmentManager"><g:message code="project.developmentManager.label" default="Development Manager" /> <span class="required-indicator">*</span></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'developmentManager', 'error')} required"><g:select id="developmentManager" name="developmentManager.id" from="${edu.uow.devdocs.Person.list()}" optionKey="id" required="" value="${projectInstance?.developmentManager?.id}" class="many-to-one"/></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'costCentre', 'error')}"><label for="costCentre"><g:message code="project.costCentre.label" default="Cost Centre" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'costCentre', 'error')}"><g:textField name="costCentre" maxlength="100" value="${projectInstance?.costCentre}"/></td>
	</tr>
	<tr>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'system', 'error')} required"><label for="system"><g:message code="project.system.label" default="System" /> <span class="required-indicator">*</span></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'system', 'error')} required"><g:select id="system" name="system.id" from="${edu.uow.devdocs.System.list()}" optionKey="id" required="" value="${projectInstance?.system?.id}" class="many-to-one"/></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'estimatedPercentComplete', 'error')}"><label for="estimatedPercentComplete"><g:message code="project.estimatedPercentComplete.label" default="Estimated Percent Complete" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'estimatedPercentComplete', 'error')}"><g:field type="number" name="estimatedPercentComplete" value="${fieldValue(bean: projectInstance, field: 'estimatedPercentComplete')}"/></td>
	</tr>
	<tr>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'availableToAllFlag', 'error')}"><label for="availableToAllFlag"><g:message code="project.availableToAllFlag.label" default="Available To All Flag" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'availableToAllFlag', 'error')}"><g:checkBox name="availableToAllFlag" value="${projectInstance?.availableToAllFlag}" /></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'flagBillable', 'error')}"><label for="flagBillable"><g:message code="project.flagBillable.label" default="Flag Billable" /></label></td>
		<td class="fieldcontain ${hasErrors(bean: projectInstance, field: 'flagBillable', 'error')}"><g:checkBox name="flagBillable" value="${projectInstance?.flagBillable}" /></td>
	</tr>
</table>
